﻿@using Jp.UI.SSO.Controllers.Consent
@model Jp.UI.SSO.Controllers.Consent.ScopeViewModel
@using Microsoft.AspNetCore.Mvc.Localization
@inject IViewLocalizer Localizer

<li class="list-group-item list-group-item-info">
    <div class="form-group row">
        <div class="col-md-3 col-sm-3 col-lg-2">
            <label class="switch switch-label switch-success">
                <input class="switch-input" type="checkbox"
                       name="ScopesConsented"
                       id="scopes_@Model.Name"
                       value="@Model.Name"
                       checked="@Model.Checked"
                       disabled="@Model.Required">
                <span class="switch-slider" data-checked="On" data-unchecked="Off"></span>
            </label>
        </div>
        <div class="col-9 text-left">
            <label for="scopes_@Model.Name">
                @if (Model.Required)
                {
                    <input type="hidden"
                           name="ScopesConsented"
                           value="@Model.Name" />
                }
                <strong>@Model.DisplayName</strong>
                @if (Model.Emphasize)
                {
                    <i class="fa fa-exclamation-circle"></i>
                }
            </label>

            @if (Model.Required)
            {
                <span><em>@Localizer["Body-(required)"]</em></span>
            }
            @if (Model.Description != null)
            {
                <div class="consent-description">
                    <label for="scopes_@Model.Name">@Model.Description</label>
                </div>
            }
        </div>
    </div>
</li>